import { method } from 'lodash';
import { request } from '../../utils/request';
import { IPage } from '../index';

export interface ICourseInfo {
  courseId: string;
  /**
   * 课程名字
   */
  name: string;
  /**
   * 课程类别
   */
  type: string;
  /**
   * 价格
   */
  price: number;
  /**
   * 描述
   */
  description: string;
  /**
   * 库存
   */
  account: number;
  /**
   * 课时
   */
  classTime: number;

  /**
   * 图片url
   */
  picture: string;

  /**
   * 上课时间
   */
  courseTime: string;

  /**
   * 教练姓名
   */
  teacherName: string;

  /**
   * 开课时间
   */
  startTime: string;
}
export const getCourseList = (data: any) =>
  request<IPage<ICourseInfo>>({
    url: '/course/list',
    method: 'post',
    data,
  });

export const addCourse = (data: any) =>
  request<boolean>({
    url: '/course/add',
    method: 'post',
    data,
  });
